﻿
Public Class frmKhoiPhuc
    Private Sub txtDuongDan_ButtonClick(sender As Object, e As DevExpress.XtraEditors.Controls.ButtonPressedEventArgs) Handles txtDuongDan.ButtonClick
        If e.Button.Tag.ToString = "btnOpenFolder" Then
            Dim dlg As New FolderBrowserDialog()
            If DialogResult.OK = (New openFolder(dlg).Invoke()) Then
                txtDuongDan.Text = dlg.SelectedPath
            End If
        End If
    End Sub

    Private Sub btnThucHien_Click(sender As Object, e As EventArgs) Handles btnThucHien.Click
        timer.Enabled = True
        timer.Start()
        btnDong.Enabled = False
        btnThucHien.Enabled = False
        txtDuongDan.Properties.Buttons(0).Enabled = False
        Me.CloseBox = False
    End Sub
    Dim x As Integer = 0
    Private Sub timer_Tick(sender As Object, e As EventArgs) Handles timer.Tick

        proTienTrinh.Properties.Step = 1
        proTienTrinh.Properties.PercentView = True
        proTienTrinh.Properties.Maximum = 100
        proTienTrinh.Properties.Minimum = 0
        x = x + 1
        proTienTrinh.Position = x
        If x = 100 Then
            timer.Enabled = False
            timer.Stop()
            btnDong.Enabled = True
            btnThucHien.Enabled = True
            txtDuongDan.Properties.Buttons(0).Enabled = True
            Me.CloseBox = True
        End If
    End Sub

    Private Sub btnDong_Click(sender As Object, e As EventArgs) Handles btnDong.Click
        Me.Close()
    End Sub
End Class